import math
PI = math.pi
none = 0
while none != 1:
    print("1.加法 2.减法 3.乘法 4.除法 5.三角函数"
          "6.求指数 7.对数  8.求阶乘  9.求二元一次方程 10.求一元二次方程 ")
    mood = int(input("请输入你想运行的操作的编号："))
    if mood == 1:
        a = float(input("请输入加数："))
        b = float(input("请输入被加的数："))
        c = a+b
        print(c)
    elif mood == 2:
        a = float(input("请输入减数："))
        b = float(input("请输入被被数："))
        c = a-b
        print(c)
    elif mood == 3:
        a = float(input("请输入乘数："))
        b = float(input("请输入被乘的数："))
        c = a*b
        print(c)
    elif mood == 4:
        print("1.除法2.求整3.求余")
        way = int(input("请输入要进行操作"))
        if way == 1:
            a = float(input("请输入除数："))
            b = float(input("请输入被除数："))
            c = a/b
            print(c)
        elif way == 2:
            a = float(input("请输入除数："))
            b = float(input("请输入被除数："))
            c = int(a//b)
            print(c)
        elif way == 3:
            a = float(input("请输入除数："))
            b = float(input("请输入被除数："))
            c = a % b
            print(c)
        else:
            print("输入错误")
    elif mood == 5:
        print("1.sin 2.cos 3.tan 4.arcsin 5.arccso 6.arctan")
        way = int(input("请输如要进行的操作："))
        if way == 1:
            a = float(input("请输如要执行的数（角度）"))
            b = math.sin((a/180)*PI)
            print(b)
        elif way == 2:
            a = float(input("请输如要执行的数（角度）"))
            b = math.cos((a/180)*PI)
            print(b)
        elif way == 3:
            a = float(input("请输如要执行的数（角度）"))
            b = math.tan((a/180)*PI)
            print(b)
        elif way == 4:
            a = float(input("请输如要执行的数"))
            b = math.asin(a)

            print((b/PI)*180)
        elif way == 5:
            a = float(input("请输如要执行的数"))
            b = math.acos((a/PI)*180)
            print((b/PI)*180)
        elif way == 6:
            a = float(input("请输如要执行的数"))
            b = math.atan((a/PI)*180)
            print((b/PI)*180)
        else:
            print("输入错误")
    elif mood == 6:
        a = float(input("请输入底数："))
        b = float(input("请输入指数："))
        c = a**b
        print(c)
    elif mood == 7:
        a = float(input("请输入底数："))
        b = float(input("请输入真数："))
        c = math.log(b, a)
        print(c)
    elif mood == 8:
        a = int(input("请输如要求的数"))
        if a <= 0:
            print("输入错误")
        b = 1
        for i in range(1, a+1):
            b = b*i
        print(b)
    elif mood == 9:
        print("输入形如ax^2+bx+c=0中的a,b,c")
        a = float(input("请输入a："))
        b = float(input("请输入b："))
        c = float(input("请输入c："))
        if b**2-4*a*c == 0:
            x1 = -(b/2*a)
            x2 = -(b/2*a)
            print("该方程的解为：x1=", x1,"x2=", x2)
        elif b**2-4*a*c < 0:
            print("该方程无实数解")
        else:
            x1 = (-b + (b**2-4*a*c)**0.5)/2*a
            x2 = (-b - (b**2-4*a*c)**0.5)/2*a
            print("x1=" + x1+"x2=" + x2)
    elif mood == 10:
        print("输入形如a1x+b1y=c1,a2x+b2y=c2的函数中的a1,b1,c1,a2,b2,c2")
        a1 = float(input("请输入a1："))
        b1 = float(input("请输入b1："))
        c1 = float(input("请输入c1："))
        a2 = float(input("请输入a2："))
        b2 = float(input("请输入b2："))
        c2 = float(input("请输入c2："))
        x = (c1*b2-c2*b1)/(a1*b2-a2*b1)
        y = (c2*a1-c1*a2) / (a1*b2-a2*b1)
        print("x=", x, "y=", y)
    else:
        print("输入错误")
    none = int(input("继续输出1以外的数,退出输出1"))












